package com.erpanderp.wam.tm.view;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.AjaxBehaviorEvent;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.swing.SwingWorker;

import org.primefaces.model.DualListModel;

import com.erpanderp.wam.adm.model.entity.SAPERPModule;
import com.erpanderp.wam.adm.model.service.SAPERPModuleDAO;
import com.erpanderp.wam.tm.model.entity.Band;
import com.erpanderp.wam.tm.model.entity.RRFSelectedSkillsList;
import com.erpanderp.wam.tm.model.entity.RecruitmentRequest;
import com.erpanderp.wam.tm.model.service.RRFDAO;
import com.erpanderp.wam.tm.model.service.RRFSelectedSkillsListDAO;
import com.erpanderp.wam.tm.model.service.SkillRatingDAO;
import com.erpanderp.wam.usm.model.entity.user.Employee;
import com.erpanderp.wam.usm.model.entity.user.WAMUser;
import com.erpanderp.wam.usm.model.service.user.EmployeeAndReportingDAO;
import com.erpanderp.wam.util.CommonLookup;
import com.erpanderp.wam.util.EmailUtil;
import com.erpanderp.wam.util.ValidationUtil;
import com.erpanderp.wam.util.WAMHostManager;


@ManagedBean
@ViewScoped
public class SubmitSavedRRFBean implements Serializable{

	private static final long serialVersionUID = 1L;
	private HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
	private HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
	ServletContext context = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
	private WAMUser wamUser = (WAMUser) session.getAttribute(CommonLookup.SESSION_ATTRIBUTE_WAMUSER);	
	
	private Map<String,String> clientMap = CommonLookup.getClient();
	private Map<String,String> interviewLevelMap = CommonLookup.getInterviewLevel();
	private Map<String,String> recruitmentModelMap = CommonLookup.getRecruitmentMode();
	private Map<String,String> recruitmentPriorityMap = CommonLookup.getRecruitmentPriority();	
	
	private DualListModel<String> primarySkills;
	List<String> primarySkillSouce = new ArrayList<String>();
	List<String> primarySkillTarget = new ArrayList<String>();
	List<String> commonSkills = new ArrayList<String>();
	
	private String rrfCode;
	private String recruiterId;
	private EmailUtil emailUtil;
	private String EMAIL_MESSAGE;
	boolean rrfExists = true;
	private Date dateAfterTwoMnths;

	private RRFDAO rrfDAO = new RRFDAO();
	private SAPERPModuleDAO saperpModuleDAO = new SAPERPModuleDAO();
    private SkillRatingDAO skillRatingDAO = new SkillRatingDAO();
    private RRFSelectedSkillsListDAO rrfSelectedSkillsListDAO=new RRFSelectedSkillsListDAO();
    private boolean FORM_VALID;
	
	private RecruitmentRequest recruitmentRequest = new RecruitmentRequest();
	private RRFSelectedSkillsList rrfSelectedSkillsList=new RRFSelectedSkillsList();

	private Map<String, Long> bandsMap = new HashMap<String, Long>();
	private List<Band> bands = new ArrayList<Band>();
	private Map<String, Long> businessFunctionMap = new HashMap<String, Long>();
    private Map<String, Long> supportFunctionMap = new HashMap<String, Long>();
    private Map<String, String> technologiesMap = new HashMap<String, String>();
    private Map<String, Long> recruitersMap = new HashMap<String, Long>(); //
    private Map<String, Long> interviewersMap = new HashMap<String, Long>();
    private Map<String, Long> interviewers2Map = new HashMap<String, Long>();
    private List<Band> businessFunctions = new ArrayList<Band>();
    private List<Band> supportFunctions = new ArrayList<Band>();
    private List<SAPERPModule> technologies = new ArrayList<SAPERPModule>();
    private List<Employee> recruiters = new ArrayList<Employee>();
    private List<Employee> interviewers = new ArrayList<Employee>();

	//Constructor
	public SubmitSavedRRFBean() {
		rrfCode = request.getParameter("rrfCode");
		recruitmentRequest = rrfDAO.getRRFByRecruitmentRequestCode(rrfCode);
		
		Calendar currentDate = Calendar.getInstance();
		SimpleDateFormat formate= new SimpleDateFormat("dd/MM/yyyy");
		//c.setTime(sdf.parse(dt));

		currentDate.setTime(recruitmentRequest.getRequestDate());
		
		//get after two months
		currentDate.add(Calendar.MONTH,2);
		
		System.out.println("===========1111111111=============="+recruitmentRequest.getRequestDate());
		try {
			//requestDate = (Date)formate.parse(toDay);
			dateAfterTwoMnths = (Date)formate.parse(formate.format(currentDate.getTime()));
			System.out.println("===========dateAfterTwoMnths=============="+dateAfterTwoMnths);
		} catch (ParseException e) {
			e.printStackTrace();
		} 
		
		bands = rrfDAO.getAllBands();
		for (Band band : bands) {
			bandsMap.put(band.getBand(), band.getBandId());
		}
		
		businessFunctions = rrfDAO.getAllBands();
		for (Band businessFunction : businessFunctions) {
			businessFunctionMap.put(businessFunction.getBusinessFunction(), businessFunction.getBandId());
		}
		
		supportFunctions = rrfDAO.getAllBands();
		for (Band band : supportFunctions) {
			supportFunctionMap.put(band.getSupportFunction(), band.getBandId());
		}		
				
		technologies = saperpModuleDAO.getSAPERPModules();
		for (SAPERPModule saperpModule : technologies) {
			technologiesMap.put(saperpModule.getSAPERPModule(),
					saperpModule.getSAPERPModule());
			
			//if(recruitmentRequest.getTechnology() == null)
				// selectedTechnology = saperpModule.getSAPERPModule();
		}
		
		recruiters=rrfDAO.getAllRecruiters();
		for (Employee recruiter : recruiters) {
			recruitersMap.put(recruiter.getFirstName()+" "+recruiter.getLastName(), recruiter.getEmployeeId());
		}
		
        changeInterviewerListener(null);
		
		interviewers = rrfDAO.getInterviewersByModule(recruitmentRequest.getTechnology().getSAPERPModule());
		for (Employee interviewers1List : interviewers) {
			interviewersMap.put(interviewers1List.getFirstName()+" "+interviewers1List.getLastName(), interviewers1List.getEmployeeId());
		}	
	   commonSkills = skillRatingDAO.getCommonSkills();
	   SAPERPModule technology = rrfDAO.getTechnologyByTechnologyName(recruitmentRequest.getTechnology().getSAPERPModule());
       primarySkillSouce = rrfDAO.getSkillsByTechnology(technology.getSAPERPModuleId());
	   primarySkills = new DualListModel<String>(primarySkillSouce, primarySkillTarget); 
	}
	
	public void changeInterviewerListener(AjaxBehaviorEvent e) {
		
		interviewersMap.clear();
		interviewers2Map.clear();
		
		if (recruitmentRequest.getTechnology() == null || recruitmentRequest.getTechnology().getSAPERPModule() == "") {
			System.out.println("No selected Technology==="+recruitmentRequest.getTechnology());
		}else{
			
			if(recruitmentRequest.getInterviewLevel().equalsIgnoreCase("Single Level")){
				System.out.println("INSIDE SINGLE LEVEL LOOP :::::::::::::::::");
				interviewers = rrfDAO.getInterviewersByModule(recruitmentRequest.getTechnology().getSAPERPModule());
				System.out.println("interviewers Size Bean :::::::::::::::::"+interviewers.size());
				for (Employee interviewers1List : interviewers) {
					interviewersMap.put(interviewers1List.getFirstName()+" "+interviewers1List.getLastName(), interviewers1List.getEmployeeId());					
				}	
			}
			if(recruitmentRequest.getInterviewLevel().equalsIgnoreCase("Two Level")){				
				interviewers = rrfDAO.getInterviewersByModule(recruitmentRequest.getTechnology().getSAPERPModule());
				for (Employee interviewers1List : interviewers) {
					interviewersMap.put(interviewers1List.getFirstName()+" "+interviewers1List.getLastName(), interviewers1List.getEmployeeId());
				}	
				
				for (Employee interviewers2List : interviewers) {
					interviewers2Map.put(interviewers2List.getFirstName()+" "+interviewers2List.getLastName(), interviewers2List.getEmployeeId());					
				}					
			}
			
			SAPERPModule technology = rrfDAO.getTechnologyByTechnologyName(recruitmentRequest.getTechnology().getSAPERPModule());
			primarySkillSouce = rrfDAO.getSkillsByTechnology(technology.getSAPERPModuleId());			
			primarySkills = new DualListModel<String>(primarySkillSouce, primarySkillTarget);  	
		}

	}
	
	//SUBMIT RRF REQUEST
		public String submitRRFRequest(){	
			validateForm();
			
			if(FORM_VALID){
				rrfExists = rrfDAO.isRRFCodeExistOrNot(rrfCode);
				
				if (!rrfExists){                  
					rrfCode=CommonLookup.getAutoGeneratedRRFCode(wamUser.getEmployee().getEmployeeCode());								
				}	
				
				SAPERPModule technology = rrfDAO.getTechnologyByTechnologyName(recruitmentRequest.getTechnology().getSAPERPModule());
				Band band = rrfDAO.getBandByBandId(recruitmentRequest.getBand().getBandId());
				Employee recruiter = rrfDAO.getRecruiterByRecruiterId(recruitmentRequest.getRecruiter().getEmployeeId());
				Employee interviewer1 = rrfDAO.getInterviewerByInterviewerId(recruitmentRequest.getInterviewer1().getEmployeeId());
				Employee interviewer2=null;
				
				
				
				
				System.out.println("===================sssss==============="+recruitmentRequest.getInterviewer2());
				
				if(recruitmentRequest.getInterviewer2() == null){
					System.out.println("INTRWR 2 Null==========================");
				}else{
					if(recruitmentRequest.getInterviewer2().getEmployeeId() != null || recruitmentRequest.getInterviewer2().getEmployeeId() != 0){
					    interviewer2 = rrfDAO.getInterviewerByInterviewerId(recruitmentRequest.getInterviewer2().getEmployeeId());
					}else{
						System.out.println("INTERVIEWER 2 IS NULL ::: "+ recruitmentRequest.getInterviewer2().getFirstName() );
						interviewer2=null;
					}
				}
				
				 List<String> targetList = new ArrayList<String>();
				 targetList = primarySkills.getTarget();
				 String targetSkills="";			 
				  for(String pskill : targetList){				  
					  targetSkills += pskill;
					  targetSkills += ", ";				  
				 }	
				targetSkills = targetSkills.substring(0,targetSkills.lastIndexOf(","));
				System.out.println("=================111111111111111111==================== ");
				//Strore technolony related selected skills
				for(String selectedSkill:targetList){
					System.out.println(" SELECTED SKILLS ADDED==========="+selectedSkill);
					rrfSelectedSkillsList.setRecruitmentRequestCode(rrfCode);
					rrfSelectedSkillsList.setSkillName(selectedSkill);
					rrfSelectedSkillsList.setTechnology(technology.getDisplayName());
					rrfSelectedSkillsList.setCreateDate(new Date());
					rrfSelectedSkillsList.setCreatedBy(CommonLookup.CREATEDBY_DEVELOPER_TEXT);
					rrfSelectedSkillsList.setStatus(CommonLookup.STATUS_ACTIVE);			
					
				    rrfSelectedSkillsListDAO.createRRFSelectedSkills(rrfSelectedSkillsList);
				}
				
				System.out.println("=================22222222222==================== ");
				//Strore common skills
				for(String commonSkill:commonSkills){
					rrfSelectedSkillsList.setRecruitmentRequestCode(rrfCode);
					rrfSelectedSkillsList.setSkillName(commonSkill);
					rrfSelectedSkillsList.setTechnology(technology.getDisplayName());
					rrfSelectedSkillsList.setCreateDate(new Date());
					rrfSelectedSkillsList.setCreatedBy(CommonLookup.CREATEDBY_DEVELOPER_TEXT);
					rrfSelectedSkillsList.setStatus(CommonLookup.STATUS_ACTIVE);			
					
				    rrfSelectedSkillsListDAO.createRRFSelectedSkills(rrfSelectedSkillsList);				
				}
				System.out.println("=================3333333333==================== ");
				recruitmentRequest.setRecruitmentRequestCode(rrfCode);
				recruitmentRequest.setRequestDate(new Date());
				recruitmentRequest.setBand(band);
				recruitmentRequest.setEmployee(wamUser.getEmployee());
				recruitmentRequest.setRecruiter(recruiter);
				recruitmentRequest.setInterviewer1(interviewer1);
				recruitmentRequest.setInterviewer2(interviewer2);
				recruitmentRequest.setTechnology(technology);
				recruitmentRequest.setInterviewerFBLevel("Level1");
				recruitmentRequest.setPrimarySkills(targetSkills);
				recruitmentRequest.setRecritmentStatus("New Recruitment Request");
				recruitmentRequest.setFormSaveOrSubmit("Submitted");
				System.out.println("=================44444444444444==================== ");
				recruitmentRequest.setCreateDate(new Date());
				recruitmentRequest.setCreatedBy(CommonLookup.CREATEDBY_DEVELOPER_TEXT);
				recruitmentRequest.setStatus(CommonLookup.STATUS_ACTIVE);
				
				rrfDAO.createRRF(recruitmentRequest);
				System.out.println("=================55555555555555==================== ");
				//MAIL TRIGGERING CODE
				System.out.println("AT CALLER METHOD: " + sendMessage());  //*******DONT REMOVE*******
				
				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,  " Your recruitment request submitted successfully.", ""));
				recruitmentRequest = new RecruitmentRequest();
				
				//for clearing purpose				
				
			/*	primarySkillTarget.clear();
				
				interviewers = rrfDAO.getInterviewersByModule(recruitmentRequest.getTechnology().getSAPERPModule());
				for (Employee interviewers1List : interviewers) {
					interviewersMap.put(interviewers1List.getFirstName()+" "+interviewers1List.getLastName(), interviewers1List.getEmployeeId());
				}
				
			    primarySkillSouce = rrfDAO.getSkillsByTechnology(technology.getSAPERPModuleId());
				primarySkills = new DualListModel<String>(primarySkillSouce, primarySkillTarget); 
				*/
				return "viewsavedrrfs";
				
				
			}else{
				System.out.println("DATA NOT SAVE MODULE...Try Again");
				return "";
			}
			
			
		}
		
		//SENDING EMAIL 
		public String sendMessage(){
			Map<String, String> hostsMap = WAMHostManager.getWAMHosts(context);
			String domainName = context.getInitParameter("domainName");
			String messageString ="";		
				
			EmployeeAndReportingDAO employeeAndReportingDAO = new EmployeeAndReportingDAO();
			Employee vp = employeeAndReportingDAO.getEmployeeByDesignation(CommonLookup.DESIGNATION_VICE_PRESIDENT_VALUE);
			Employee ch = employeeAndReportingDAO.getEmployeeByDesignation(CommonLookup.DESIGNATION_SENIOR_REGIONAL_MANAGER_LABEL);
			
			emailUtil = new EmailUtil();
			if (hostsMap.get(CommonLookup.DEV_EMAIL) == null) {
				System.out.println("PRODUCTION");
				String[] to = { recruitmentRequest.getRecruiter().getEmail() };
				String[] cc = { vp != null ? vp.getEmail() : "",  ch != null ? ch.getEmail() : ""};
				emailUtil.setRecieverAddresses(to);
				emailUtil.setCCAddresses(cc);
			} else {
				System.out.println("DEVELOPMENT");
				String[] to = { hostsMap.get(CommonLookup.DEV_EMAIL) };
				String[] cc = {hostsMap.get(CommonLookup.DEV_EMAIL), hostsMap.get(CommonLookup.DEV_EMAIL)};
				emailUtil.setRecieverAddresses(to);
				emailUtil.setCCAddresses(cc);
			}
					
			String requestURL = "tm/viewRRFByReportingManager.html?rrfCode=" + rrfCode+"&EMPID="+wamUser.getEmployeeCode()+"&recruiterId="+recruitmentRequest.getRecruiter().getEmployeeCode() ;
			String privateLink = "http://" + hostsMap.get(CommonLookup.PRIVATEHOST) + "/" + domainName + "/" + requestURL;
			String publicLink = "http://" + hostsMap.get(CommonLookup.PUBLICHOST) + "/"	+ domainName + "/" + requestURL;
			
			messageString = "Dear " + recruitmentRequest.getRecruiter().getFirstName() + " " + recruitmentRequest.getRecruiter().getLastName() + "" +
									",<br /><br />" +
									
									"<table style='border: 1px solid #d9d9d9;'>" +
							        "<tr> <td>Recruitment Request Id </td><td> : </td><td>" + rrfCode+ " </td></tr>" +
							        "<tr> <td>Technology</td><td> : </td> <td>" + recruitmentRequest.getTechnology().getDisplayName() + " </td></tr>" +						       
							        "</table><br/>"+							       
							        "<a style='color:#FF9933;font-weight: bold;' href=\""+
							        privateLink + "\">" + "Please click here to view RRF Request and upload profiles" + "</a /><br />"+
									"(Employees who are in Hyderabad office)"+"<br /><br />"+
									"<a style='color:#FF9933;font-weight: bold;' href=\""+
									publicLink + "\">" + "Please click here to view RRF Request and upload profiles" + "</a /><br />"+
									"(out side Hyderabad office)"+"<br /><br />"+
									
									"Thanks & Regards, <br />"+CommonLookup.WAM_DEVTEAM_SIGNATURE;
			emailUtil.setMessage(messageString);
			emailUtil.setSenderEmail("podquick@erpanderp.com", "WAM - Dev Team");
			
			emailUtil.setSubject(wamUser.getEmployee().getFirstName()+" "+wamUser.getEmployee().getLastName() +"( "+rrfCode+" ) - Recruitment Request");
			
			SwingWorker worker = new SwingWorker<String, Object>() {
				@Override
				protected String doInBackground() throws Exception {
					EMAIL_MESSAGE = emailUtil.processAndSendEmail();
					return null;
				}

				@Override
				protected void done() {
						System.out.println("DONE " + EMAIL_MESSAGE);		
				}
			};
			worker.execute();
			System.out.println( "BEFORE RETURNING: " + EMAIL_MESSAGE);
			return EMAIL_MESSAGE;
		}
		
		//Validations Test
		private void validateForm(){
			FORM_VALID = true;		
			
		
		
			if(ValidationUtil.isEmpty(recruitmentRequest.getBand().getBandId() != 0 ? recruitmentRequest.getBand().toString() : null , "Band", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}
		   if(ValidationUtil.isEmpty(recruitmentRequest.getBand().getBusinessFunction(), "Business Function", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}	  
		   if(ValidationUtil.isEmpty(recruitmentRequest.getNoofPositions(), "No of Positions", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}
		   if(ValidationUtil.isEmpty(recruitmentRequest.getTechnology().getSAPERPModule(), "Technology", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}	  
		   if(ValidationUtil.isEmpty(recruitmentRequest.getRelaventExperienceFrom() != 0 ? recruitmentRequest.getRelaventExperienceFrom().toString() : null, "Relavent Experience From", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}
		   if(ValidationUtil.isEmpty(recruitmentRequest.getRelaventExperienceTo() != 0 ? recruitmentRequest.getRelaventExperienceTo().toString() : null , "Relavent Experience To", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}	 
		   if(ValidationUtil.isEmpty(recruitmentRequest.getSalaryRangeFrom() != 0 ? recruitmentRequest.getSalaryRangeFrom().toString() : null , "Salary Range From", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}
		   if(ValidationUtil.isEmpty(recruitmentRequest.getSalaryRangeTo() != 0 ? recruitmentRequest.getSalaryRangeTo().toString() : null , "Salary Range To", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}
		   if(ValidationUtil.isEmpty(recruitmentRequest.getJobLocation(), "	Job Location", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}
		   if(ValidationUtil.isEmpty((recruitmentRequest.getRecritmentEndDate()!=null) ? recruitmentRequest.getRecritmentEndDate().toString():null, "Recruitment End Date", null, FacesContext.getCurrentInstance()) != null){
		
			   FORM_VALID = false;
		   }   
		  
		  if(recruitmentRequest.getRecritmentEndDate() != null){
			   if(recruitmentRequest.getRecritmentEndDate().before(recruitmentRequest.getRequestDate())){
				   FORM_VALID = false;
				   FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN," Recruitment end date Should be greater than rrf create date", ""));
			   }
			   System.out.println("recruitmentRequest.getRecritmentEndDate()====================="+recruitmentRequest.getRecritmentEndDate());
			   System.out.println("dateAfterTwoMnths====================="+dateAfterTwoMnths);
			   if(recruitmentRequest.getRecritmentEndDate().after(dateAfterTwoMnths)){
				   FORM_VALID = false;
				   FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN,"Recruitment end date should not be exceed 2 months (or) 60 Days", ""));
			   }
		  }
		 //  Date afterTwoMonthsDate = recruitmentRequest.getRecritmentEndDate()+ 60;
		 
			System.out.println("Finally FORM_VALID is :::::"+FORM_VALID);		
		}
	
	//GETTERS AND SETTERS
	public HttpSession getSession() {
		return session;
	}
	public void setSession(HttpSession session) {
		this.session = session;
	}

	public HttpServletRequest getRequest() {
		return request;
	}
	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}
	
	public WAMUser getWamUser() {
		return wamUser;
	}
	public void setWamUser(WAMUser wamUser) {
		this.wamUser = wamUser;
	}

	public String getRrfCode() {
		return rrfCode;
	}
	public void setRrfCode(String rrfCode) {
		this.rrfCode = rrfCode;
	}


	public String getRecruiterId() {
		return recruiterId;
	}
	public void setRecruiterId(String recruiterId) {
		this.recruiterId = recruiterId;
	}


	public RRFDAO getRrfDAO() {
		return rrfDAO;
	}


	public void setRrfDAO(RRFDAO rrfDAO) {
		this.rrfDAO = rrfDAO;
	}


	public RecruitmentRequest getRecruitmentRequest() {
		return recruitmentRequest;
	}


	public void setRecruitmentRequest(RecruitmentRequest recruitmentRequest) {
		this.recruitmentRequest = recruitmentRequest;
	}


	public Map<String, Long> getBandsMap() {
		return bandsMap;
	}


	public void setBandsMap(Map<String, Long> bandsMap) {
		this.bandsMap = bandsMap;
	}


	public Map<String, Long> getSupportFunctionMap() {
		return supportFunctionMap;
	}


	public void setSupportFunctionMap(Map<String, Long> supportFunctionMap) {
		this.supportFunctionMap = supportFunctionMap;
	}


	public Map<String, String> getTechnologiesMap() {
		return technologiesMap;
	}


	public void setTechnologiesMap(Map<String, String> technologiesMap) {
		this.technologiesMap = technologiesMap;
	}


	public Map<String, Long> getBusinessFunctionMap() {
		return businessFunctionMap;
	}


	public void setBusinessFunctionMap(Map<String, Long> businessFunctionMap) {
		this.businessFunctionMap = businessFunctionMap;
	}


	public Map<String, Long> getRecruitersMap() {
		return recruitersMap;
	}


	public void setRecruitersMap(Map<String, Long> recruitersMap) {
		this.recruitersMap = recruitersMap;
	}


	public Map<String, Long> getInterviewersMap() {
		return interviewersMap;
	}


	public void setInterviewersMap(Map<String, Long> interviewersMap) {
		this.interviewersMap = interviewersMap;
	}


	public Map<String, Long> getInterviewers2Map() {
		return interviewers2Map;
	}


	public void setInterviewers2Map(Map<String, Long> interviewers2Map) {
		this.interviewers2Map = interviewers2Map;
	}


	public List<Employee> getInterviewers() {
		return interviewers;
	}


	public void setInterviewers(List<Employee> interviewers) {
		this.interviewers = interviewers;
	}


	public SkillRatingDAO getSkillRatingDAO() {
		return skillRatingDAO;
	}


	public void setSkillRatingDAO(SkillRatingDAO skillRatingDAO) {
		this.skillRatingDAO = skillRatingDAO;
	}


	public Map<String,String> getClientMap() {
		return clientMap;
	}


	public void setClientMap(Map<String,String> clientMap) {
		this.clientMap = clientMap;
	}


	public Map<String,String> getInterviewLevelMap() {
		return interviewLevelMap;
	}


	public void setInterviewLevelMap(Map<String,String> interviewLevelMap) {
		this.interviewLevelMap = interviewLevelMap;
	}


	public Map<String,String> getRecruitmentModelMap() {
		return recruitmentModelMap;
	}


	public void setRecruitmentModelMap(Map<String,String> recruitmentModelMap) {
		this.recruitmentModelMap = recruitmentModelMap;
	}


	public Map<String,String> getRecruitmentPriorityMap() {
		return recruitmentPriorityMap;
	}


	public void setRecruitmentPriorityMap(Map<String,String> recruitmentPriorityMap) {
		this.recruitmentPriorityMap = recruitmentPriorityMap;
	}

	public DualListModel<String> getPrimarySkills() {
		return primarySkills;
	}

	public void setPrimarySkills(DualListModel<String> primarySkills) {
		this.primarySkills = primarySkills;
	}

	public EmailUtil getEmailUtil() {
		return emailUtil;
	}

	public void setEmailUtil(EmailUtil emailUtil) {
		this.emailUtil = emailUtil;
	}

	public String getEMAIL_MESSAGE() {
		return EMAIL_MESSAGE;
	}

	public void setEMAIL_MESSAGE(String eMAIL_MESSAGE) {
		EMAIL_MESSAGE = eMAIL_MESSAGE;
	}

	public Date getDateAfterTwoMnths() {
		return dateAfterTwoMnths;
	}

	public void setDateAfterTwoMnths(Date dateAfterTwoMnths) {
		this.dateAfterTwoMnths = dateAfterTwoMnths;
	}

	public SAPERPModuleDAO getSaperpModuleDAO() {
		return saperpModuleDAO;
	}

	public void setSaperpModuleDAO(SAPERPModuleDAO saperpModuleDAO) {
		this.saperpModuleDAO = saperpModuleDAO;
	}

	public RRFSelectedSkillsListDAO getRrfSelectedSkillsListDAO() {
		return rrfSelectedSkillsListDAO;
	}

	public void setRrfSelectedSkillsListDAO(
			RRFSelectedSkillsListDAO rrfSelectedSkillsListDAO) {
		this.rrfSelectedSkillsListDAO = rrfSelectedSkillsListDAO;
	}

	public boolean isFORM_VALID() {
		return FORM_VALID;
	}

	public void setFORM_VALID(boolean fORM_VALID) {
		FORM_VALID = fORM_VALID;
	}

	public RRFSelectedSkillsList getRrfSelectedSkillsList() {
		return rrfSelectedSkillsList;
	}

	public void setRrfSelectedSkillsList(RRFSelectedSkillsList rrfSelectedSkillsList) {
		this.rrfSelectedSkillsList = rrfSelectedSkillsList;
	}

	public List<Band> getBands() {
		return bands;
	}

	public void setBands(List<Band> bands) {
		this.bands = bands;
	}

	public List<Band> getBusinessFunctions() {
		return businessFunctions;
	}

	public void setBusinessFunctions(List<Band> businessFunctions) {
		this.businessFunctions = businessFunctions;
	}

	public List<Band> getSupportFunctions() {
		return supportFunctions;
	}

	public void setSupportFunctions(List<Band> supportFunctions) {
		this.supportFunctions = supportFunctions;
	}

	public List<SAPERPModule> getTechnologies() {
		return technologies;
	}

	public void setTechnologies(List<SAPERPModule> technologies) {
		this.technologies = technologies;
	}

	public List<Employee> getRecruiters() {
		return recruiters;
	}

	public void setRecruiters(List<Employee> recruiters) {
		this.recruiters = recruiters;
	}



	

}
